<template>
  <div>
     <div class="config">
        <div class="back" onclick="window.history.go(-1)"><img src="../assets/images/back.png" alt=""></div>
        <p>常见问题</p>
    </div>
    <div  v-for="item in data" @click="toDetail(item.title,item.value)">
            <div class="row">             
                <p>{{item.title}}</p>
                <img src="../assets/images/gd.png" alt="" class="gengduo">
            </div>   
    </div>
    

  </div>
</template>

<script>
export default {
    name: "commonProblem",
    data() {
        return {
            data: {}
        };
    },
    beforeCreate() {
        document.getElementsByTagName("body")[0].style.background = "#fff";
    },
    methods: {
        toDetail(title, value) {
            console.log(title, value);
            localStorage.setItem("value", value);
            this.$router.push({ name: "problemDetail",params:{title:title} });
        }
    },
    mounted() {
        this.axios({
            method: "post",
            url: `${this.siteUrl}/getProblem`
        })
            .then(response => {
             
                if ((response.data.result == 200)) {
                    this.data = response.data.data;
                } else {
                    alert("请求失败");
                }
            })
            .catch(function(error) {
                console.log(error);
            });
    }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.row {
    height: 60px;
    background: #fff;
    position: relative;
    border-bottom: 1px solid #f2f2f2;
}
.row p {
    position: absolute;
    left: 10px;
    top: 18px;
    font-size: 14px;
}

.row .gengduo {
    position: absolute;
    height: 12px;
    top: 24px;
    right: 10px;
}
</style>
